home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / GMSV03B.lha / GamesMaster / Source / E / ScreenDemos / ScrollScreen336.e < prev    next >
Encoding:
Text File  |  1996-09-12  |  2.3 KB  |  71 lines

  1. /*
  2. ** Scroll Screen 336
  3. ** -----------------
  4. ** This demo allows you to legally scroll up to 50 screens in either
  5. ** direction by setting the HBUFFER flag.  Normally we would blit blocks down
  6. ** the left and right hand side to give an impression of heaps of screens -
  7. ** maybe later...
  8. ** 
  9. */
  10.  
  11. MODULE 'games','games/games'
  12.  
  13. PROC main()
  14.    DEF screen:PTR TO gamescreen, palette:PTR TO INT, zbxy:LONG,
  15.        loadpic:PTR TO picture
  16.  
  17.    palette := [    $0000,$0130,$0FCB,$0FA9,$0D88,$0965,$0644,$0211,
  18.         $0400,$0444,$0FF0,$0432,$0CC0,$0150,$0501,$0880,
  19.         $0261,$0271,$0382,$0492,$05A3,$05B4,$0677,$06C4,
  20.         $0788,$09AA,$0BCC,$0801,$0901,$0A02,$0701,$0601
  21.           ]:INT;
  22.  
  23.    screen :=  [    GSV1,0,
  24.         0,0,0,                -> Screen_Mem1/2/3
  25.         0,                    -> Screen link.
  26.         palette,              -> Address of palette.
  27.         0,                    -> Address of rasterlist.
  28.         0,                    -> Amt of colours in palette.
  29.         320,256,336,256,      -> Screen & Pic Height/Width
  30.         5,                    -> Amt of planes.
  31.         0,0,                  -> Top of screen offsets, X/Y
  32.         0,0,                  -> X/Y counters (for scrolling).
  33.         HSCROLL OR HBUFFER,   -> Special attributes.
  34.         LORES,                -> Screen mode.
  35.         INTERLEAVED,          -> Screen type
  36.         0                     -> Reserved.               
  37.           ]:gamescreen;    
  38.  
  39.    loadpic := [    PCV1,0,             -> Version header.
  40.         0,                  -> Destination.
  41.         336,256,            -> Width, Height.
  42.         5,                  -> Amount of Planes.
  43.         32,                 -> Amount of colours.
  44.         palette,            -> Palette (remap).
  45.         LORES,              -> Screen mode.
  46.         INTERLEAVED,        -> Destination.
  47.         0                   -> Parameters.
  48.               ]:picture;
  49.  
  50.    IF gmsbase := OpenLibrary('games.library',0)
  51.       SetUserPri()
  52.       IF (Add_Screen(screen) = ERR_OK)
  53.          loadpic.data := screen.memptr1;
  54.          IF (LoadPic('GAMESLIB:data/IFF.Pic336',loadpic) = ERR_OK)
  55.             Show_Screen(screen)
  56.         Read_Mouse(JPORT1) -> Initialise mouse port.
  57.  
  58.         REPEAT
  59.           zbxy := Read_Mouse(JPORT1)
  60.           screen.picxoffset := screen.picxoffset+getZBXYx(zbxy)
  61.           Move_Picture(screen)
  62.           Wait_OSVBL()
  63.         UNTIL !(zbxy AND MB_LMB)
  64.  
  65.          ENDIF
  66.          Delete_Screen(screen)        
  67.       ENDIF
  68.    CloseLibrary(gmsbase)
  69.    ENDIF
  70. ENDPROC
  71.